<template>
  <div>
    <h2>用户登录列表</h2>
    <table class="table table-bordered">
      <tr>
        <td>账号</td>
        <td>密码</td>
        <td>注册时间</td>
      </tr>
      <tr v-for="item in list">
        <td>{{ item.U_Account }}</td>
        <td>{{ item.U_Pwd.slice(0,4)+'***' }}</td>
        <td>{{ item.U_Date.substr(0,10) }}</td>
      </tr>
    </table>
  </div>
</template>
<script setup lang="ts">
import { ref,onMounted } from 'vue'
import axios from 'axios'
//修改了这条数据
const list =ref([{
  U_Account:'',
  U_Pwd:'',
  U_Date:''
}])

onMounted(()=>{
  show()
})

const show=()=>{
  axios({
    url:'http://localhost:54566/api/User/GetUserLoginList',
    method:'get',
    params:list.value
  })
  .then((res)=>{
    list.value=res.data
  })
  .catch((err)=>{
    console.log(err)
  })
}

</script>